package com.filldream.fastboot.base.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.filldream.fastboot.common.okutil.cls.dto.ClsNewsSimpleItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

public interface ClsNewsMapper extends BaseMapper<ClsNewsSimpleItem> {

    @Select("SELECT id FROM cls_news_simple_item where source_type = #{sourceType} and publish_time >= CURDATE( ) - INTERVAL 40 DAY;")
    List<String> getAllId(Integer sourceType);

    @Select("SELECT * FROM cls_news_simple_item WHERE send_public = 0 limit 99")
    List<ClsNewsSimpleItem> getPublicNews();
    void modifyPublicNews(List<Long> dbIds);

    List<ClsNewsSimpleItem> getWaitWsNews();
    void modifyWsNews(List<Long> dbIds);

    Integer hasRepeatTitle(@Param("title") String title,@Param("notSourceType") Integer notSourceType);

    List<ClsNewsSimpleItem> getNotSendOwnerList(@Param("sendOwnerList") List<String> sendOwnerList,@Param("sourceType") Integer sourceType);

}
